<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scaleble=no">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>客服</title>
    <link rel="stylesheet" href="css/app.css">
    <link rel="stylesheet" href="css/首页/index.css">
</head>

<body>
    <header class="top_bg">
        <div class="h45 ac">
            <a href="javascript:;" class="left_btn"></a>
            付款明细
            <a href="javascript:;" class="right_btn">历史回复</a>
        </div>
    </header>
    <div class="customerService marT10">
        <div class="bg-white">
            <textarea placeholder="请输入需要反馈的问题"></textarea>
            <div class="fileStyle">
                <input type="file" class="file_input">
                <img class="file_img" src="img/add.png" width="70" height="70">
            </div>
        </div>
        <div class="bottom_btn">
            <button type="button">提交</button>
        </div>
    </div>


    <script src="js/jquery-1.11.3.js"></script>
    <script>
        $(".file_input").change(function () {
            var objUrl = getObjectURL(this.files[0]);
            // console.log("objUrl = " + objUrl);
            if (objUrl) {
                $(".file_img").attr("src", objUrl);
            }
        });
        //建立一個可存取到該file的url
        function getObjectURL(file) {
            var url = null;
            if (window.createObjectURL != undefined) { // basic
                url = window.createObjectURL(file);
            } else if (window.URL != undefined) { // mozilla(firefox)
                url = window.URL.createObjectURL(file);
            } else if (window.webkitURL != undefined) { // webkit or chrome
                url = window.webkitURL.createObjectURL(file);
            }
            return url;
        }
    </script>
</body>

</html>